# -*- coding: utf-8 -*-
'''
@author: Hugo
@file: Redis网址去重.py
@time: 2021/8/21 20:45
'''
import redis
from icecream import ic

conn = redis.Redis()
def ff_redis(page:int):
    url = 'www.ff.com'
    for i in range(page):
        urls = url + str(i)
        if conn.sadd('fff',urls):
            ic(urls+'done')
        else:
            ic(urls+'已经存在')
        continue

while True:
    page = input('输入:')
    if page == 'f':
        break
    ff_redis(int(page))







